//
//  LSZSecondaryInterfaceManager.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/8/27.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZSecondaryInterfaceManager.h"

@implementation LSZSecondaryInterfaceManager
-(id)initWithSecondaryInterface:(NSArray *)array
{
    self = [super init];
    if (self) {
        self.arrayData = [[NSMutableArray alloc]init];
        NSMutableArray * arrayMut = [[NSMutableArray alloc]init];
        for (NSDictionary * diction in array) {
            LSZSecondaryInterfaceMg * mg = [[LSZSecondaryInterfaceMg alloc]init];
            if([NullStringjudgment(NSStr(diction[@"publishTime"])) containsString:@" "]) {
                NSArray *array = [NullStringjudgment(NSStr(diction[@"publishTime"])) componentsSeparatedByString:@" "]; //从字符A中分隔成2个元素的数组
                mg.publishTime = array[0] ;
            }else{
                mg.publishTime = NullStringjudgment(NSStr(diction[@"publishTime"]));
            }
            mg.id_id = NullStringjudgment(NSStr(diction[@"id"]));
            mg.recommend = NullStringjudgment(NSStr(diction[@"recommend"]));
            mg.coverUrl = [NSString stringWithFormat:@"%@%@",URLTotalWeb,NullStringjudgment(NSStr(diction[@"coverUrl"]))];
            mg.name = NullStringjudgment(NSStr(diction[@"name"]));
            mg.summary = NullStringjudgment(NSStr(diction[@"summary"]));
            if ([[diction allKeys] containsObject:@"counts"]) {
                mg.counts = NullStringjudgment(NSStr(diction[@"counts"]));
            }else{
                mg.counts = @"";
            }
            if ([[diction allKeys] containsObject:@"sortIndex"]) {
                mg.sortIndex = NullStringjudgment(NSStr(diction[@"sortIndex"]));
            }else{
                mg.sortIndex = @"";
            }
            if ([[diction allKeys] containsObject:@"minutes"]) {
                mg.minutes = NullStringjudgment(NSStr(diction[@"minutes"]));
            }
            if ([[diction allKeys] containsObject:@"totalScore"]) {
                mg.totalScore = NullStringjudgment(NSStr(diction[@"totalScore"]));
            }
            if ([[diction allKeys] containsObject:@"passScore"]) {
                mg.passScore = NullStringjudgment(NSStr(diction[@"passScore"]));
            }
            [arrayMut addObject:mg];
        }
        self.arrayData = arrayMut;
    }
    return self;
}
@end
@implementation LSZSecondaryInterfaceMg
@end
